< previous page page_43 next page >

Page 43
    short dmColor;
    short dmDuplex;
    short dmYResolution;
    short dmTTOption;
    short dmCollate;
    WCHAR   dmFormName[CCHFORMNAME];
    WORD    dmLogPixels;
    DWORD   dmBitsPerPel;
    DWORD   dmPelsWidth;
    DWORD   dmPelsHeight;
    DWORD   dmDisplayFlags;
    DWORD   dmDisplayFrequency;
    DWORD   dmICMMethod;
    DWORD   dmICMIntent;
    DWORD   dmMediaType;
    DWORD   dmDitherType;
    DWORD   dmICCManufacturer;
    DWORD   dmICCModel;
    DWORD   dmPanningWidth;
    DWORD   dmPanningHeight;
} DEVMODEW, *PDEVMODEW, *NPDEVMODEW, *LPDEVMODEW;
There are two versions of the structure defined, one for use with the ANSI function entry point, the other for use with the Unicode entry point. The only difference between them, as you can see, is that the strings within the structures are arrays of bytes under the ANSI version and WCHARs (16-bit integers) under the Unicode version. The EnumDisplaySettings function is described as follows in the Win32 documentation:
BOOL EnumDisplaySettings(
    LPCTSTR lpszDeviceName,     // specifies the display device
    DWORD iModeNum,             // specifies the graphics mode
    LPDEVMODE lpDevMode         // points to structure to receive settings
   );
The lpszDeviceName parameter should be NULL to use the current display device.
The iModeNum parameter refers to the number of the display mode you wish to examine. The trick for enumerating all of the display settings is to start with 0 and increment this parameter until the function returns 0, indicating that the setting is invalid.
The lpDevMode parameter is a pointer to a DEVMODE structure that will be loaded with the display setting corresponding to the iModeNum parameter.

 
< previous page page_43 next page >